repo.or.cz
/
and.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Adding some more judges, here and there.
[and.git]
/
UVa
/
10198 - Counting
/
10198.cpp
blob
b7dfbe70c05691b8bbd478cc566f927979b3ec75
1
using namespace
std
;
2
#include <algorithm>
3
#include <iostream>
4
#include <iterator>
5
#include <sstream>
6
#include <fstream>
7
#include <cassert>
8
#include <climits>
9
#include <cstdlib>
10
#include <cstring>
11
#include <string>
12
#include <cstdio>
13
#include <vector>
14
#include <cmath>
15
#include <queue>
16
#include <deque>
17
#include <stack>
18
#include <list>
19
#include <map>
20
#include <set>
21
22
#define D(x) cout << #x
" is "
<< x << endl
23
24
long long
dp
[
1010
];
25
26
int
main
(){
27
dp
[
0
] =
1
;
28
for
(
int
i
=
0
;
i
<=
1000
; ++
i
){
29
dp
[
i
+
1
] +=
2
*
dp
[
i
];
30
dp
[
i
+
2
] +=
dp
[
i
];
31
dp
[
i
+
3
] +=
dp
[
i
];
32
}
33
int
n
;
34
while
(
cin
>>
n
)
cout
<<
dp
[
n
] <<
endl
;
35
return
0
;
36
}